﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EjemploSVN.Models;
using System.Data.Entity;

namespace EjemploSVN.DataAccess
{
    public class StudentsRepo : BaseRepo<Student>, IStudentsRepo
    {
        public override DbSet<Student> Set
        {
            get { return this.DbContext.Students; }
        }
        //public DbSet<Student> Set
        //{
        //    get { return this.DbContext.Students; }
        //}

        public StudentsRepo(IUnitOfWorkFactory uowFactory) : base(uowFactory)
        {
        }


        public IList<Student> GetEmpiezanConA()
        {
            return this.Set.Where(s => s.Name.StartsWith("A"))
                            .OrderBy(s => s.Name)
                            .ToList();
        }

    }
}